<div class="addresses index">
    <h2><?php echo __('Addresses'); ?></h2>
    <table cellpadding="0" cellspacing="0">
        <tr>
            <th><?php echo $this->Paginator->sort('id'); ?></th>
            <th><?php echo $this->Paginator->sort('user_id'); ?></th>
            <th><?php echo $this->Paginator->sort('is_primary'); ?></th>
            <th><?php echo $this->Paginator->sort('mailing_address'); ?></th>
            <th><?php echo $this->Paginator->sort('apt_no'); ?></th>
            <th><?php echo $this->Paginator->sort('city'); ?></th>
            <th><?php echo $this->Paginator->sort('state_id'); ?></th>
            <th><?php echo $this->Paginator->sort('zip'); ?></th>
            <th><?php echo $this->Paginator->sort('no_of_aduldts'); ?></th>
            <th><?php echo $this->Paginator->sort('no_of_children'); ?></th>
            <th><?php echo $this->Paginator->sort('is_allowed_mail'); ?></th>
            <th class="actions"><?php echo __('Actions'); ?></th>
        </tr>
        <?php foreach ($addresses as $address): ?>
            <tr>
                <td><?php echo h($address['Address']['id']); ?>&nbsp;</td>
                <td>
                    <?php echo $this->Html->link($address['User']['id'], array('controller' => 'users', 'action' => 'view', $address['User']['id'])); ?>
                </td>
                <td><?php echo h($address['Address']['is_primary']); ?>&nbsp;</td>
                <td><?php echo h($address['Address']['mailing_address']); ?>&nbsp;</td>
                <td><?php echo h($address['Address']['apt_no']); ?>&nbsp;</td>
                <td><?php echo h($address['Address']['city']); ?>&nbsp;</td>
                <td>
                    <?php echo $this->Html->link($address['State']['title'], array('controller' => 'states', 'action' => 'view', $address['State']['id'])); ?>
                </td>
                <td><?php echo h($address['Address']['zip']); ?>&nbsp;</td>
                <td><?php echo h($address['Address']['no_of_aduldts']); ?>&nbsp;</td>
                <td><?php echo h($address['Address']['no_of_children']); ?>&nbsp;</td>
                <td><?php echo h($address['Address']['is_allowed_mail']); ?>&nbsp;</td>
                <td class="actions">
                    <?php echo $this->Html->link(__('View'), array('action' => 'view', $address['Address']['id'])); ?>
                    <?php echo $this->Html->link(__('Edit'), array('action' => 'edit', $address['Address']['id'])); ?>
                    <?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $address['Address']['id']), array(), __('Are you sure you want to delete # %s?', $address['Address']['id'])); ?>
                </td>
            </tr>
        <?php endforeach; ?>
    </table>
    <p>
        <?php
        echo $this->Paginator->counter(array(
            'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
        ));
        ?>	</p>
    <div class="paging">
        <?php
        echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
        echo $this->Paginator->numbers(array('separator' => ''));
        echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
        ?>
    </div>
</div>
<div class="actions">
    <h3><?php echo __('Actions'); ?></h3>
    <ul>
        <li><?php echo $this->Html->link(__('New Address'), array('action' => 'add')); ?></li>
        <li><?php echo $this->Html->link(__('List Users'), array('controller' => 'users', 'action' => 'index')); ?> </li>
        <li><?php echo $this->Html->link(__('New User'), array('controller' => 'users', 'action' => 'add')); ?> </li>
        <li><?php echo $this->Html->link(__('List States'), array('controller' => 'states', 'action' => 'index')); ?> </li>
        <li><?php echo $this->Html->link(__('New State'), array('controller' => 'states', 'action' => 'add')); ?> </li>
    </ul>
</div>
